<template>
  <ant-modal
    modalWidth="576"
    modalHeight="500"
    :visible="open"
    :modal-title="formTitle"
    :adjust-size="true"
    @cancel="cancel"
  >
    <a-form-model ref="form" :model="form" :rules="rules" slot="content" layout="vertical">
      <a-row :gutter="32">
        <a-col :span="12">
          <a-form-model-item label="容器ID" prop="containerId">
            <a-input v-model="form.containerId" placeholder="请输入容器ID"/>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="容器名称" prop="containerName">
            <a-textarea v-model="form.containerName" placeholder="请输入容器名称" :rows="4"/>
          </a-form-model-item>
        </a-col>
      </a-row>
      <a-row :gutter="32">
        <a-col :span="12">
          <a-form-model-item label="镜像" prop="image">
            <a-input v-model="form.image" placeholder="请输入镜像"/>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="创建时间" prop="containerCreateTime">
            <a-date-picker
              v-model="form.containerCreateTime"
              valueFormat="YYYY-MM-DD"
              :show-today="true"
              placeholder="选择日期"
              style="width: 100%"
            />
          </a-form-model-item>
        </a-col>
      </a-row>
      <a-row :gutter="32">
        <a-col :span="12">
          <a-form-model-item label="命令" prop="command">
            <a-textarea v-model="form.command" placeholder="请输入命令" :rows="4"/>
          </a-form-model-item>
        </a-col>
        <a-col :span="12" >
          <a-form-model-item label="状态" prop="status">
            <a-radio-group v-model="form.status">
              <a-radio
                v-for="(dict, index) in statusOptions"
                :key="index"
                :value="dict.dictValue"
              >
                {{ dict.dictLabel }}
              </a-radio>
            </a-radio-group>
          </a-form-model-item>
        </a-col>
      </a-row>
      <a-row :gutter="32">
      </a-row>
    </a-form-model>
    <template slot="footer">
      <a-button :disabled="disabled" @click="cancel">
        取消
      </a-button>
      <a-button type="primary" :disabled="disabled" @click="submitForm(true)">
        保存
      </a-button>
    </template>
  </ant-modal>
</template>
<script>
import ContainerAddForm from './ContainerForm'
export default {
  ...ContainerAddForm
}
</script>
